package com.demo.rocketmq.consumer;

import com.demo.rocketmq.constants.TopicConstants;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @author cyj
 **/
@Slf4j
@Service
@RocketMQMessageListener(topic = TopicConstants.CONSUMER_FAIL_TOPIC, consumerGroup = "fail_consumer_group")
public class TestFailTopicMqConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("TestFailTopicMqConsumer message:{}", message);
        throw new RuntimeException();
    }
}
